﻿<%@ Register Src="CompanyRegNumControl.ascx" TagName="CompanyRegNumControl" TagPrefix="uc1" %>
<%@ Register src="LabelWithTimedMsg.ascx" tagname="LabelWithTimedMsg" tagprefix="uc1" %>

<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="CompanyFormControl.ascx.cs"
    Inherits="TeamTime.CompanyFormControl" %>
<asp:Panel ID="pnlDetails" runat="server" SkinID="PopupPanel" DefaultButton="btnSave">
    <table cellspacing="0" border="0">
        <tr id="trID" runat="server" visible="true">
            <td>
                ID
            </td>
            <td style="text-align: justify;">
                <asp:TextBox ID="txtID" runat="server" BackColor="#E0E0E0" BorderStyle="None" ReadOnly="true"></asp:TextBox>
                &nbsp;
                <asp:LinkButton ID="lnkLoadDup" runat="server" OnClick="lnkLoadDup_Click" Visible="False">This company already exists.  Click to Load.</asp:LinkButton>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:HyperLink ID="hypSupplier" runat="server"></asp:HyperLink>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:HyperLink ID="hypEnterprise" runat="server"></asp:HyperLink>
            </td>
        </tr>
        <tr>
            <td>
                Registered Name
            </td>
            <td>
                <asp:TextBox ID="txtCompanyNameRegistered" runat="server" Width="250px" MaxLength="50"
                    ReadOnly="true"></asp:TextBox>&nbsp;
                <asp:RequiredFieldValidator ID="reqValCompanyNameRegistered" runat="server" ControlToValidate="txtCompanyNameRegistered"
                    Display="Dynamic" ErrorMessage="* Required" ValidationGroup="popup"></asp:RequiredFieldValidator>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:HyperLink ID="hypContactRecs" runat="server" Target="_blank">View Contact Records</asp:HyperLink>
            </td>
        </tr>
        <tr>
            <td>
                Trading As
            </td>
            <td>
                <asp:TextBox ID="txtCompanyName" runat="server" Width="250px" MaxLength="50" ReadOnly="true"></asp:TextBox>&nbsp;
                <asp:RequiredFieldValidator ID="reqValCompanyName" runat="server" ControlToValidate="txtCompanyName"
                    Display="Dynamic" ErrorMessage="* Required" ValidationGroup="popup"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                Company Registration No.
            </td>
            <td>
                <uc1:CompanyRegNumControl ID="CompanyRegNumControl1" runat="server" OnCompanyTypeChanged="CompanyRegNumControl1_CompanyTypeChanged" />
            </td>
        </tr>
        <tr>
            <td>
                VAT Number
            </td>
            <td>
                <asp:TextBox ID="txtVATRegNum" runat="server" Width="300px" MaxLength="100" ReadOnly="true"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Website Address
            </td>
            <td>
                <asp:TextBox ID="txtWebsiteAddress" runat="server" Width="300px" MaxLength="100"
                    ReadOnly="true"></asp:TextBox> (e.g. www.tep.co.za)
                &nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                    ControlToValidate="txtWebsiteAddress" ErrorMessage="Please enter a valid URL"
                    ValidationExpression="([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?" Display="Dynamic"
                    ValidationGroup="popup"></asp:RegularExpressionValidator></td>
        </tr>
        <tr>
            <td>
                Telephone Number
            </td>
            <td>
                <asp:TextBox ID="txtTelephoneNumber" runat="server" Width="150px" MaxLength="50"
                    ReadOnly="true"></asp:TextBox>
                &nbsp;(e.g.0317001122)
                <asp:RequiredFieldValidator ID="reqValTelephoneNumber" runat="server" ControlToValidate="txtTelephoneNumber"
                    Display="Dynamic" ErrorMessage="* Required" ValidationGroup="popup"></asp:RequiredFieldValidator>
                &nbsp;<asp:RegularExpressionValidator ID="regTelephoneNumber" runat="server" 
                    ControlToValidate="txtTelephoneNumber" 
                    ErrorMessage="Please enter a valid telephone no." 
                    ValidationExpression="\d{10}|\d{13}" ValidationGroup="popup"></asp:RegularExpressionValidator></td>
        </tr>
        <tr>
            <td>
                Fax Number
            </td>
            <td>
                <asp:TextBox ID="txtFaxNumber" runat="server" Width="150px" MaxLength="50" ReadOnly="true"></asp:TextBox>
                (e.g.0317001123)
                <asp:RegularExpressionValidator ID="regFaxNumber" runat="server" 
                    ControlToValidate="txtFaxNumber" ErrorMessage="Please enter a valid fax no." 
                    ValidationExpression="\d{10}|\d{13}" ValidationGroup="popup"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                Cellphone
            </td>
            <td>
                <asp:TextBox ID="txtCellphone" runat="server" Width="150px" MaxLength="50" ReadOnly="true"></asp:TextBox>
                (e.g.0821231234)
                <asp:RegularExpressionValidator ID="regCellphone" runat="server" 
                    ControlToValidate="txtCellphone" 
                    ErrorMessage="Please enter a valid cellphone no." 
                    ValidationExpression="\d{10}|\d{13}" ValidationGroup="popup"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                Contact Person
            </td>
            <td>
                <asp:TextBox ID="txtContactPerson" runat="server" Width="150px" MaxLength="50" ReadOnly="true"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator ID="reqValContactPerson" runat="server" Display="Dynamic"
                    ErrorMessage="* Required" ValidationGroup="popup" ControlToValidate="txtContactPerson"></asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td>
                Postal Address
            </td>
            <td>
                <asp:TextBox ID="txtAddressPostal" runat="server" Width="377px" MaxLength="50" ReadOnly="true"
                    TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Postal Code
            </td>
            <td>
                <asp:TextBox ID="txtAddressPostalCode" runat="server" Width="30px" MaxLength="10"
                    ReadOnly="true"></asp:TextBox>
                &nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server"
                    ControlToValidate="txtAddressPostalCode" ErrorMessage="Please enter a valid SA postal code"
                    ValidationExpression="\d{4}" ValidationGroup="popup"></asp:RegularExpressionValidator></td>
        </tr>
        <tr>
            <td>
                Physical Address
            </td>
            <td>
                <asp:TextBox ID="txtAddressPhysical" runat="server" Width="377px" MaxLength="50"
                    ReadOnly="true" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                City/Town
            </td>
            <td>
                <asp:TextBox ID="txtCityTown" runat="server" Width="300px" MaxLength="100" ReadOnly="true"></asp:TextBox>
                &nbsp;<asp:RequiredFieldValidator ID="reqCityTown" runat="server" ControlToValidate="txtCityTown"
                    Display="Dynamic" ErrorMessage="* Required" ValidationGroup="popup"></asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td>
                Suburb
            </td>
            <td>
                <asp:TextBox ID="txtSuburb" runat="server" Width="300px" MaxLength="100" ReadOnly="true"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Area Code
            </td>
            <td>
                <asp:TextBox ID="txtAddressPhysicalCode" runat="server" Width="30px" MaxLength="10"
                    ReadOnly="true"></asp:TextBox>
                &nbsp;<asp:RequiredFieldValidator ID="reqAddressPhysicalCode" runat="server" ControlToValidate="txtAddressPhysicalCode"
                    Display="Dynamic" ErrorMessage="* Required" ValidationGroup="popup"></asp:RequiredFieldValidator></td>
        </tr>
        <tr>
            <td>
                Province
            </td>
            <td>
                <asp:DropDownList ID="ddlProvinceID" runat="server" Enabled="false">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>
                Email Address
            </td>
            <td>
                <asp:TextBox ID="txtEmailAddress" runat="server" Width="150px" MaxLength="50" ReadOnly="true"></asp:TextBox>
                (e.g. admin@tep.co.za)
                <asp:RequiredFieldValidator ID="reqvalEmailAddress" runat="server" ControlToValidate="txtEmailAddress"
                    Display="Dynamic" ErrorMessage="* Required" ValidationGroup="popup"></asp:RequiredFieldValidator>
                &nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
                    ControlToValidate="txtEmailAddress" ErrorMessage="Please enter a valid email address"
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ValidationGroup="popup"></asp:RegularExpressionValidator></td>
        </tr>
        <tr>
            <td>
                Notes
            </td>
            <td>
                <asp:TextBox ID="txtNotes" runat="server" Width="379px" ReadOnly="true" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <asp:Button ID="btnSave" runat="server" Text="Save" ValidationGroup="popup" OnClick="btnSave_Click" />
                <uc1:LabelWithTimedMsg ID="SaveMessage" runat="server" />
            </td>
        </tr>
        <tr id="trModif" runat="server" visible="true">
            <td colspan="2">
                Modified By&nbsp;
                <asp:TextBox ID="txtUserNameModifiedBy" runat="server" Width="137px" MaxLength="4"
                    ReadOnly="true" BackColor="#E0E0E0" BorderStyle="None"></asp:TextBox>
                On
                <asp:TextBox ID="txtRecordDate" runat="server" Width="62px" MaxLength="10" ReadOnly="true"
                    BackColor="#E0E0E0" BorderStyle="None"></asp:TextBox>
            </td>
        </tr>
    </table>
</asp:Panel>
